package cloud.seri.auth.domain

import org.springframework.data.annotation.Id
import org.springframework.data.mongodb.core.index.Indexed
import org.springframework.data.mongodb.core.mapping.Document
import org.springframework.data.mongodb.core.mapping.Field
import javax.validation.constraints.NotNull
import javax.validation.constraints.Size

/**
 * A Role.
 */
@Document(collection = "seri_role")
class Role(

    @Id
    var id: String? = null,

    @get: NotNull
    @get: Size(max = 45)
    @Field("role_name")
    @Indexed(unique = true)
    var name: String? = null,

    @get: Size(max = 45)
    @Field("role_alias")
    @Indexed(unique = true)
    var title: String? = null,

    @get: NotNull
    @Field("status")
    var status: Int? = null,

    @Field("sort")
    var sort: Int? = null,

    @Field("remark")
    var remark: String? = null

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
) : AbstractAuditingEntity()
